import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger/dist';
import { AdminuserService } from './adminuser.service';
import { CreateAdminuserDto } from './dto/create-adminuser.dto';
import { LoginAdminUserDto } from './dto/login-adminuser.dto';
import { UpdateAdminuserDto } from './dto/update-adminuser.dto';

@ApiTags('管理员')
@Controller('adminuser')
export class AdminuserController {
  constructor(private readonly adminuserService: AdminuserService) {}

  @Post()
  create(@Body() createAdminuserDto: CreateAdminuserDto) {
    return this.adminuserService.create(createAdminuserDto);
  }

  @Get()
  findAll() {
    return this.adminuserService.findAll();
  }



  @Patch(':id')
  update(@Param('id') id: string, @Body() updateAdminuserDto: UpdateAdminuserDto) {
    return this.adminuserService.update(+id, updateAdminuserDto);
  }

  @Post('/adminLogin')
  async adminLogin(@Body() dto: LoginAdminUserDto) {
    return await this.adminuserService.adminLogin(dto)
  }

}
